const express = require('express')
const app = express()



app.all('*', function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*")
  next()
})

app.get('/users',(req,res)=>{
  let result = {
    'data':[
      {a:1},
      {b:2}
    ]
  }
  res.send({
    error: 0,
    message: 'it is ok',
    data:result.data
  })
})

app.listen(3001)